<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0px;
            padding: 0px;
        }

        textarea {
            resize: none;
        }

        ul {
            width: 300px;
            margin: 100px auto;
            list-style:  none;
        }

        ul li {
            background-color: pink;
        }
    </style>
</head>

<body>
    <textarea name="" id="" cols="30" rows="10" class=""></textarea>
    <button class="btn">发布</button>
    <ul></ul>
    <script>
        var btn = document.querySelector('.btn');
        var text = document.querySelector('textarea');
        var ulEl = document.querySelector('ul');

        btn.onclick = function () {
            var liEl = document.createElement('li');
            ulEl.appendChild(liEl);
            liEl.innerText = text.value;
        }
    </script>
</body>

</html>